package com.xinyun.client;

import com.xinyun.server.protocol.ProtocolData;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;

/**
 * Created by bubusy on 16/5/21.
 */
public class ProtocolClientHandler extends ChannelInboundHandlerAdapter {
    @Override
    public void channelRead(ChannelHandlerContext ctx, Object msg) {
        ProtocolData pd = (ProtocolData) msg;
        System.out.println(pd);
    }

    @Override
    public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
        cause.printStackTrace();
        ctx.close();
    }
}
